/*
 * @Author: your name
 * @Date: 2020-07-15 16:52:29
 * @LastEditTime: 2020-07-17 10:30:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \dcg-demo\src\injects\myInjects\index.js
 */

/**
 * !!!慎用全局注册
 *  这里只适合注册，具体实现需拆分到单独的文件
 */

import Vue from 'vue'
import config from '@/config'
import {globalFilter} from './filter.js'
import {globalDirective} from './directive.js'
import {axios, http} from '@/api/index'

/* 原型属性/方法 Vue.prototype (使用 $ 前缀) */
Vue.prototype.$env = Object.freeze(process.env)
Vue.prototype.$config = config
Vue.prototype.$axios = axios
Vue.prototype.$http = http

/* 注册 全局指令 Vue.directive */
globalDirective.forEach(v => {
  Vue.directive(v.directiveName, v.directiveFn)
})

// 注册过滤器
globalFilter.forEach(v => {
  Vue.filter(v.filterName, v.filterFn)
})

/* 全局组件 Vue.component */
